<template>
  <el-dialog
    class="dialogStyle"
    style="width: 75vw"
    :title="'5-2大巷皮带传感器参数'"
    v-model="visible"
  >
    <div class="container">
      <div class="panel">
        <div class="panel-header">
          <h2>5-2大巷皮带传感器参数</h2>
          <span class="note"
            ><span class="note-highlight">注:</span>
            以下温度单位为:℃，振动单位为:mm/s</span
          >
        </div>

        <div class="table-container">
          <el-row class="header-row">
            <el-col :span="5">设备名称</el-col>
            <el-col :span="3">参数</el-col>
            <el-col :span="5">设备名称</el-col>
            <el-col :span="3">参数</el-col>
            <el-col :span="5">设备名称</el-col>
            <el-col :span="3">参数</el-col>
          </el-row>

          <el-row>
            <el-col :span="5">1-A 卸载滚筒外侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">7-B 张紧导向滚筒内侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">6-A 2#副驱滚筒外侧温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">1-B 卸载滚筒内测振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">8-A 张紧滚筒内测振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">6-B 2#副驱滚筒内测温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">2-A 卸载支撑滚筒外侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">8-B 张紧滚筒外侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">7-A 张紧导向滚筒外侧温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">2-B 卸载支撑滚筒内侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">1-A 卸载滚筒外侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">7-B 张紧导向滚筒内侧温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">3-A 1#主驱滚筒外侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">1-B 卸载滚筒内侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">8-A 张紧滚筒内侧温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">3-B 1#主驱滚筒内侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">2-A 卸载支撑滚筒外侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">8-B 张紧滚筒外侧温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">4-A 1#副驱滚筒外侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">2-B 卸载支撑滚筒内侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">1#冷却风扇电机温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">4-B 1#副驱滚筒内侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">3-A 1#主驱滚筒外侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">1#循环泵电机温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">5-A 2#主驱滚筒外侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">3-B 1#主驱滚筒内侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">2#冷却风扇电机温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">5-B 2#主驱滚筒内侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">4-A 1#副驱滚筒外侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">2#循环泵电机温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">6-A 2#副驱滚筒外侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">4-B 1#副驱滚筒内侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">3#冷却风扇电机温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">6-B 2#副驱滚筒内侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">5-A 2#主驱滚筒外侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">3#循环电机温度</el-col>
            <el-col :span="3">xxx</el-col>
          </el-row>
          <el-row>
            <el-col :span="5">7-A 张紧导向滚筒外侧振动</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5">5-B 2#主驱滚筒内侧温度</el-col>
            <el-col :span="3">xxx</el-col>
            <el-col :span="5"></el-col>
            <el-col :span="3"></el-col>
          </el-row>
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<script setup lang="ts">
import { ref, computed } from "vue";
import { act } from "@/utils/websocket";
import { operator } from "@/utils/op_enums";
import { useTagResults } from "@/utils/useTagResults";

const visible = ref(false);

// const computedResults = (
//   key: string,
//   op: operator,
//   op_number?: number,
//   retain?: number
// ) =>
//   computed(() => {
//     return useTagResults(act.PD_52.PD_52[key], op, op_number, retain);
//   });

const openDialog = () => {
  visible.value = true;
};

defineExpose({
  openDialog,
});
</script>

<style scoped lang="scss">
.dialogStyle {
  .container {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .panel {
    display: flex;
    flex-direction: column;
    background-color: var(--el-bg-color);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }

  .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--el-color-primary-light-9);
    border-bottom: 1px solid var(--el-border-color-light);

    h2 {
      margin: 0;
      font-size: 16px;
      font-weight: 500;
      color: var(--el-text-color-primary);
    }

    .note {
      font-size: 14px;
      color: var(--el-text-color-regular);

      &-highlight {
        color: var(--el-color-danger);
        font-weight: 500;
      }
    }
  }

  .table-container {
    overflow-x: auto;
    border: 1px solid var(--el-border-color-light);
  }

  .header-row {
    .el-col {
      background-color: var(--el-fill-color) !important;
      font-weight: 500;
      color: var(--el-text-color-primary);
      padding: 8px 5px;
      text-align: center;
      font-size: 13px;
    }
  }

  .el-row {
    .el-col {
      border: 1px solid var(--el-border-color-lighter);
      padding: 8px 5px;
      text-align: center;
      font-size: 12px;
      color: var(--el-text-color-regular);
      min-height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;

      &:nth-child(1),
      &:nth-child(3),
      &:nth-child(5) {
        font-weight: 500;
        color: var(--el-text-color-primary);
        background-color: var(--el-fill-color-lighter);
      }
    }
  }
}
</style>
